Skip to content

SAK-51312 Gradebook improve GbModalWindow focus management and accessibility #13554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

ottenhoff
Copy link
Contributor

Refactored the GbModalWindow component to address several focus management and accessibility issues:

  • Replaced naive initial focus on the first input element. The modal now defaults to focusing the main content panel itself. Added setInitialFocusComponent() method to allow explicitly setting a specific component to receive initial focus.

  • Implemented robust focus trapping. Tabbing is now confined within the modal boundary (including the header/close button). The trap correctly handles looping from the last to the first element (Tab) and first to last (Shift+Tab). This uses a namespaced event listener attached to the document to reliably capture key events.

  • Removed the positionAtTop functionality and associated JavaScript, allowing the modal to use default browser/Wicket positioning logic.

…ibility

Refactored the GbModalWindow component to address several focus management and accessibility issues:

- Replaced naive initial focus on the first input element. The modal now defaults to focusing the main content panel itself. Added `setInitialFocusComponent()` method to allow explicitly setting a specific component to receive initial focus.

- Implemented robust focus trapping. Tabbing is now confined within the modal boundary (including the header/close button). The trap correctly handles looping from the last to the first element (Tab) and first to last (Shift+Tab). This uses a namespaced event listener attached to the document to reliably capture key events.

- Removed the `positionAtTop` functionality and associated JavaScript, allowing the modal to use default browser/Wicket positioning logic.
@ottenhoff ottenhoff requested a review from kunaljaykam April 9, 2025 14:24
Copy link
Member

@kunaljaykam kunaljaykam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ottenhoff ottenhoff merged commit f531f63 into sakaiproject:master Apr 10, 2025
5 checks passed
ern pushed a commit that referenced this pull request Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants